package top.wardyan.wmes.rfid.kqa.vo;

/**
 * @author Hechaobin
 * @Description 基础应答包
 * @since 2021-07-17
 */
public class BaseResponse<T>  {

    /**
     * 状态码 200-正常，其他-异常
     */
    private int code;

    /**
     * 异常时的提示信息
     */
    private String msg="";

    /**
     * 应答内容
     */
    private T data;

    public BaseResponse<T> setResult(int code,String errorMsg){
        this.code=code;
        this.msg=errorMsg;
        return this;
    }
    public BaseResponse<T> setSuccess(Object obj){
        this.code=200;
        this.data=(T)obj;
        return this;
    }
	public int getCode() {
		return code;
	}
	public BaseResponse<T> setCode(int code) {
		this.code = code;
		return this;
	}
	public String getMsg() {
		return msg;
	}
	public BaseResponse<T> setMsg(String msg) {
		this.msg = msg;
		return this;
	}
	public T getData() {
		return data;
	}
	public BaseResponse<T> setData(T data) {
		this.data = data;
		return this;
	}
    
    
}
